TESetSelect
TESetSelect Sets the selection range
#include <TextEdit.h> TextEdit
void TESetSelect(selStart, selEnd, hTE );
long selStart; offset of character to select
long selEnd; offset of last character to select
TEHandle hTE; edit record handle
TESetSelect sets the selection range for the specified edit record. The
previous range (if any) is unhighlighted and the specified range is highlighted.
selStart specifies the start of the desired selection range, in characters
relative to the start of the edit record. Valid values range from 0 to
32767.
selEnd specifies the end of the desired selection range, in characters
relative to the start of the edit record. Valid values range from 0 to
32767.
hTE is a handle obtained via TENew (old style TextEdit record) or
TEStylNew (new style TextEdit record). It leads to a
variable-length TERec structure and identifies the edit record to be
affected by this change.
Returns: none

Notes: If selEnd is beyond the last character of the edit record, the
range is extended to just past the last character. Thus, a simple way to set
the selection to include the entire record is to set selStart = 0 and selEnd =
32767.
If selStart is the same as selEnd, the selection range is collapsed to an
insertion point and the vertical-bar caret is displayed.
If you use TESetSelect to place the insertion point at the end of a line,
TESetSelect places it on the right side of the previous line by default. To
place it on the left side of the next line instead, set the clikStuff field in hTE
to 255 before you call TESetSelect. To place it on the right side of the
previous line again, set clikStuff to 0.
Selection is typically performed by the user with the mouse and
implemented via TEClick. However, TESetSelect is useful for
highlighting initial default values.
If you have called TEAutoView(TRUE,hTE), the selection range will
automatically be scrolled into view.